<template>
 <div>
   <div class="d1">
     <p>子组件展示：{{provideState.age}}</p>
     <button @click="add">加</button>
   </div>
 </div>
</template>

<script setup>
import { inject } from 'vue';

let provideState = inject('provideState')
let aa = provideState.age.value
let add = () =>{
  aa++
  provideState.changeAge(aa)
}


</script>
<style scoped lang ='less'>
</style>